import Vue from "vue";
import VueRouter from "vue-router";
// 要告诉 vue 使用 vueRouter
Vue.use(VueRouter);

const routes = [
	
	{
		path : '/',
		name : 'ceshi',
		component: resolve => require(['./components/ceshi.vue'], resolve),
	},
	{
		path : '/shop',
		name : 'shop',
		component: resolve => require(['./components/shop/shop.vue'], resolve),
	},
	{
		path : '/shoplist',
		name : 'shoplist',
		component: resolve => require(['./components/shop/list.vue'], resolve),
	},{
		
		path : '/shopdetails',
		name : 'details',
		component: resolve => require(['./components/shop/details.vue'], resolve),
	},
	{
		
		path : '/map',
		name : 'map',
		component: resolve => require(['./components/shop/map.vue'], resolve),
	},
	{
		path : '/introduce',
		name : 'introduce',
		component: resolve => require(['./components/introduce/index.vue'], resolve),
	},
	{
		path : '/introducedetails',
		name : 'introducedetails',
		component: resolve => require(['./components/introduce/details.vue'], resolve),
	},
	{
		path : '/guarantee',   //质保
		name : 'guarantee',
		component: resolve => require(['./components/guarantee/index.vue'], resolve),
	},
	{
		path : '/submitChainStore',   //查询页面
		name : 'submitChainStore',
		component: resolve => require(['./components/guarantee/submitChainStore.vue'], resolve),
	},
	{
		path : '/submitChaindetails',   //添加页面
		name : 'submitChaindetails',
		component: resolve => require(['./components/guarantee/details.vue'], resolve),
		
	},
	{
		path : '/success',   //
		name : 'success',
		component: resolve => require(['./components/guarantee/success.vue'], resolve),
		
	},
	{
		path : '/book',   //
		name : 'book',
		component: resolve => require(['./components/guarantee/book.vue'], resolve),
		
	},
	
	//查询  guaranteeselect
	{
		path : '/guaranteeselect',   //
		name : 'guaranteeselect',
		component: resolve => require(['./components/guaranteeselect/index.vue'], resolve),
		
	},
	{
		path : '/selectChaindetails',   //
		name : 'selectChaindetails',
		component: resolve => require(['./components/guaranteeselect/select.vue'], resolve),
		
	},
	
    
]
//以下代码解决路由地址重复点击的报错问题
const originalPush = VueRouter.prototype.push
   VueRouter.prototype.push = function push(location) {
   return originalPush.call(this, location).catch(err => err)
}
var router =  new VueRouter({
    routes,
	mode: 'history'
})
export default router;